package com.hcms.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hcms.admin.service.ISysAdminRoleService;
import com.hcms.mybatis.entity.SysAdminRole;
import com.hcms.mybatis.entity.SysRole;
import com.hcms.mybatis.mapper.SysAdminRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * <p>
 * 后台用户和角色关系表 服务实现类
 * </p>
 *
 * @author achenxw@126.com
 * @since 2023-02-13
 */
@Service
public class SysAdminRoleServiceImpl extends ServiceImpl<SysAdminRoleMapper, SysAdminRole> implements ISysAdminRoleService {

    @Autowired
    private SysAdminRoleMapper sysAdminRoleMapper;

    @Override
    public Collection<SysRole> getRoles(Long adminId) {
        return sysAdminRoleMapper.getRolesByAdminId(adminId);
    }
}
